﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ue.Extensions;

namespace Ue.Tests.Extensions
{
    [TestClass]
    public class NullableExtensionsTests
    {
        [TestMethod]
        public void FuncByNotNull()
        {
            var obj = new
            {
                FirstName = "lsw",
                LastName = "web"
            };

            Assert.AreEqual("lsw", obj.FuncByNotNull(item => item.FirstName));
        }

        [TestMethod]
        public void FuncByIsNull()
        {
            object obj=null;

            Assert.AreEqual(null, obj.FuncByNotNull(item => item));

            Assert.AreEqual("lsw", obj.FuncByNotNull(item => item,"lsw"));
        }
    }
}
